package com.cxd.performance.utils;

import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFPalette;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.*;

/**
 * Author: Calvin
 * Date: 2019-08-30 8:40
 * Description: Excel 样式工具类
 */
public class ExcelStyleUtils {

	private ExcelStyleUtils() {

	}

   /**
	* 蓝背，白字，有边框
	*/
   public static HSSFCellStyle getTitleBuleStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.LEFT);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
		font.setFontHeightInPoints((short) 12);//设置字体大小
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 59, (byte) 0, (byte) 32, (byte) 96);
		style.setFillForegroundColor((short) 59);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * 绿背，白字，有边框
	 */
	public static CellStyle getGreenBoldStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 63, (byte) 0, (byte) 176, (byte) 80);
		style.setFillForegroundColor((short) 63);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * @desc 获取加粗、居中的样式，有边框
	 */
	public static HSSFCellStyle getBoldCenterStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		style.setFont(font);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * @desc 获取加粗、居中的样式
	 */
	public static HSSFCellStyle getBoldLeftStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		style.setFont(font);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

   /**
	* 字体加粗，居右
	*/
   public static HSSFCellStyle getBoldRightStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.RIGHT);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		style.setFont(font);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * 红色，加粗，居左
	 */
	public static HSSFCellStyle getRedBoldLeftStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.LEFT);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		font.setFontHeightInPoints((short) 12);//设置字体大小
		font.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex());
		style.setFont(font);
		return style;
	}
	/**
	 * 黄背，白字
	 */
	public static HSSFCellStyle getGOLDBoldStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setFontName("微软雅黑");
		font.setBold(true);
		font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 60, (byte) 255, (byte) 204, (byte) 0);
		style.setFillForegroundColor((short) 60);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}
   /**
	*
	* 深黄背，白字
	* @param wb
	* @return
	*/
   public static HSSFCellStyle getDarkYellowStyle(HSSFWorkbook wb) {
	   HSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);
	   style.setVerticalAlignment(VerticalAlignment.CENTER);
	   HSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(true);
	   font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   HSSFPalette palette = wb.getCustomPalette();
	   palette.setColorAtIndex((short) 60, (byte) 255, (byte) 192, (byte) 0);
	   style.setFillForegroundColor((short) 60);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.LIGHT_ORANGE.getIndex());
	   return style;
   }
   /**
	*
	* 深黄背，白字
	* @param wb
	* @return
	*/
   public static HSSFCellStyle getYellowStyle(HSSFWorkbook wb) {
	   HSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);
	   style.setVerticalAlignment(VerticalAlignment.CENTER);
	   HSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(true);
	   font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   HSSFPalette palette = wb.getCustomPalette();
	   palette.setColorAtIndex((short) 40, (byte) 255, (byte) 255, (byte) 0);
	   style.setFillForegroundColor((short) 60);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.LIGHT_ORANGE.getIndex());
	   return style;
   }


	/**
	 *
	 * 蓝背，白字
	 * @param wb
	 * @return
	 */
	public static HSSFCellStyle getBuleBoldWhiteStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.LEFT);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setFontName("微软雅黑");
		font.setBold(true);
		font.setFontHeightInPoints((short) 12);//设置字体大小
		font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 61, (byte) 79, (byte) 129, (byte) 189);
		style.setFillForegroundColor((short) 61);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * 蓝背，黄字
	 * @param wb
	 */
	public static HSSFCellStyle getBuleBoldLeftStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.LEFT);
		style.setVerticalAlignment(VerticalAlignment.BOTTOM);
		HSSFFont font = wb.createFont();
		font.setFontName("微软雅黑");
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 60, (byte) 255, (byte) 204, (byte) 0);
		font.setColor((short) 60);
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		HSSFPalette palette1 = wb.getCustomPalette();
		palette1.setColorAtIndex((short) 58, (byte) 54, (byte) 96, (byte) 164);
		style.setFillForegroundColor((short) 58);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}
	/**
	 * @desc 获取黄色加粗、居中的样式
	 */
	public static HSSFCellStyle getYellowBoldLeftStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.LEFT);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(true);
		font.setFontName("微软雅黑");
		font.setColor(HSSFColor.HSSFColorPredefined.WHITE.getIndex());
		style.setFont(font);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex((short) 60, (byte) 255, (byte) 204, (byte) 0);
		style.setFillForegroundColor((short) 60);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}

	/**
	 * @desc 获取黄色居中的样式
	 */
	public static HSSFCellStyle getYellowNormalCenterStyle(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		font.setBold(false);
		font.setFontName("微软雅黑");
		style.setFont(font);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex(HSSFColor.HSSFColorPredefined.YELLOW.getIndex(), (byte)255,(byte)192, (byte)0);
		style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex());
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		style.setBorderBottom(BorderStyle.THIN);
		style.setBorderLeft(BorderStyle.THIN);
		style.setBorderRight(BorderStyle.THIN);
		style.setBorderTop(BorderStyle.THIN);
		return style;
	}


	/**
	 * @desc 黄色居中并且没有边框
	 */
	public static HSSFCellStyle getYellowNormalCenterStyleWithNoBorder(HSSFWorkbook wb) {
		HSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		HSSFFont font = wb.createFont();
		 font.setFontName("微软雅黑");
		font.setBold(true);
		style.setFont(font);
		HSSFPalette palette = wb.getCustomPalette();
		palette.setColorAtIndex(HSSFColor.HSSFColorPredefined.YELLOW.getIndex(), (byte)255,(byte)255, (byte)0);
		style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex());
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		return style;
	}

   /**
	* 设置字体颜色为红色，加粗
	*/
   public static CellStyle getRedLeftBorder(Workbook wb){
	  HSSFCellStyle style = (HSSFCellStyle) wb.createCellStyle();
	  style.setAlignment(HorizontalAlignment.LEFT);
	  style.setVerticalAlignment(VerticalAlignment.BOTTOM);
	  HSSFFont font = (HSSFFont) wb.createFont();
	  font.setFontName("微软雅黑");
	  font.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex());//字体颜色
	  font.setFontHeightInPoints((short)12);
	  font.setBold(true);//字体增粗
	  //把字体应用到当前的样式
	  style.setFont(font);
	  return style;
   }
   /**
	* 淡黄背景
	*/
   public static CellStyle getColorStyle(Workbook wb){
		CellStyle style = wb.createCellStyle();
		//字体居中
		style.setAlignment(HorizontalAlignment.CENTER);//水平居中
		style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
		style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex());
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	    style.setBorderBottom(BorderStyle.THIN);
	    style.setBorderLeft(BorderStyle.THIN);
	    style.setBorderRight(BorderStyle.THIN);
	    style.setBorderTop(BorderStyle.THIN);
		Font font = wb.createFont();
		font.setFontName("微软雅黑");
		font.setBold(false);
		style.setFont(font);
		style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex());
		return style;
	}
   /**
	* 字体居中，有边框
	*/
   public static CellStyle getCenterFontStyle(Workbook wb){
	   CellStyle style = wb.createCellStyle();
	   //字体居中
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   Font font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(false);//字体不增粗
	   style.setFont(font);
	   return style;
   }

   /**
	* 字体居右，有边框，加粗，字号自定义
	*/
   public static CellStyle getRightFontBoldStyle(Workbook wb, int fontSize){
	   CellStyle style = wb.createCellStyle();
	   //字体居中
	   style.setAlignment(HorizontalAlignment.RIGHT);//水平居右
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   Font font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setFontHeightInPoints((short)fontSize);
	   font.setBold(true);//字体增粗
	   style.setFont(font);
	   return style;
   }
   /**
	* 字体居中，有边框，无字号
	*/
   public static CellStyle getCenterBaseFontStyle(Workbook wb){
	   CellStyle style = wb.createCellStyle();
	   //字体居中
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   Font font = wb.createFont();
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   return style;
   }
   //--------------------------------------------360颜色修改-----------------------------------------
   /**
	* @desc 绿背字体居中并且有边框（前三名）
	*/
   public static XSSFCellStyle getGreenBackgroundColor(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   XSSFDataFormat df =  wb.createDataFormat();  //此处设置数据格式
	   style.setDataFormat(df.getFormat("#,#0.00"));
	   style.setAlignment(HorizontalAlignment.CENTER);
	   style.setVerticalAlignment(VerticalAlignment.CENTER);
	   style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex());
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex());
	   XSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(false);
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   return style;
   }
   /**
	 * @desc 玫瑰背字体居中并且有边框（后三名）
	 */
   public static XSSFCellStyle getRoseBackgroundColor(XSSFWorkbook wb) {
		XSSFCellStyle style = wb.createCellStyle();
		XSSFDataFormat df =  wb.createDataFormat();  //此处设置数据格式
		style.setDataFormat(df.getFormat("#,#0.00"));
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.ROSE.getIndex());
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.ROSE.getIndex());
		XSSFFont font = wb.createFont();
		font.setFontName("微软雅黑");
		font.setBold(false);
		style.setFont(font);
	    style.setBorderBottom(BorderStyle.THIN);
	    style.setBorderLeft(BorderStyle.THIN);
	    style.setBorderRight(BorderStyle.THIN);
	    style.setBorderTop(BorderStyle.THIN);
		return style;
	}
   /**
	* 浅蓝背，黑字（评级）
	*/
   public static XSSFCellStyle getBuleBoldStyle(XSSFWorkbook wb) {
		XSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		XSSFFont font = wb.createFont();
		font.setBold(true);
		font.setFontName("微软雅黑");
		font.setColor(IndexedColors.BLACK.getIndex());
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//	        style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
		style.setFillForegroundColor(new XSSFColor( new java.awt.Color(189, 215, 238)));
	    style.setBorderBottom(BorderStyle.THIN);
	    style.setBorderLeft(BorderStyle.THIN);
	    style.setBorderRight(BorderStyle.THIN);
	    style.setBorderTop(BorderStyle.THIN);
		return style;
	}
   /**
	 *
	 * 深蓝背，白字(他评优势)
	 * @param wb
	 * @return
	 */
   public static XSSFCellStyle getBuleBoldWhiteStyle(XSSFWorkbook wb) {
		XSSFCellStyle style = wb.createCellStyle();
		style.setAlignment(HorizontalAlignment.CENTER);
		style.setVerticalAlignment(VerticalAlignment.CENTER);
		XSSFFont font = wb.createFont();
		 font.setFontName("微软雅黑");
		font.setBold(true);
		font.setFontHeightInPoints((short) 12);//设置字体大小
		font.setColor(IndexedColors.WHITE.getIndex());
		style.setFont(font);
		style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		style.setFillForegroundColor(IndexedColors.TEAL.getIndex());
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
		return style;
	}
   /**
	*
	* 灰背，黑字(待改进建议（能力）)
	* @param wb
	* @return
	*/
   public static XSSFCellStyle getGrayBoldWhiteStyle(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   XSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(true);
	   font.setFontHeightInPoints((short) 12);//设置字体大小
	   font.setColor(IndexedColors.BLACK.getIndex());
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillForegroundColor(new XSSFColor(new java.awt.Color(150,150,150)));
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   return style;
   }
   /**
	* 八个字段：
	* 淡黄背，白字(待改进建议（他评待改进项）)
	* @param wb
	* @return
	*/
   public static XSSFCellStyle getLightYellowBoldWhiteStyle(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   XSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(true);
	   font.setFontHeightInPoints((short) 12);//设置字体大小
	   font.setColor(IndexedColors.BLACK.getIndex());
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//		   style.setFillForegroundColor(IndexedColors.DARK_YELLOW.getIndex());
	   style.setFillForegroundColor(new XSSFColor(new java.awt.Color(148, 138, 84)));
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   return style;
   }
   /**
	*
	* 浅蓝背，黑字，不加粗(详细报告（内容）)
	* @param wb
	* @return
	*/
   public static XSSFCellStyle getLightGreyWhiteStyle(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   XSSFFont font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(false);
	   font.setFontHeightInPoints((short) 12);//设置字体大小
	   font.setColor(IndexedColors.BLACK.getIndex());
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   return style;
   }

   /**
	*
	* 浅蓝背，黑字，不加粗(详细报告（内容）)
	* @param wb
	* @return
	*/
   public static XSSFCellStyle getLightBuleWhiteStyle(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   XSSFFont font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   font.setFontHeightInPoints((short) 12);//设置字体大小
	   font.setColor(IndexedColors.BLACK.getIndex());
	   style.setFont(font);
	   style.setWrapText(true);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillForegroundColor(new XSSFColor(new java.awt.Color(217,225,242)));
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   return style;
   }
   /**
	* @desc 字体居左有边框不加粗浅灰色
	*/
   public static XSSFCellStyle getNormalLeftStyleWithBorderAndGrey(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setWrapText(true);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillForegroundColor(new XSSFColor(new java.awt.Color(217,225,242)));
	   return style;
   }
   /**
	* @desc 字体居左有边框不加粗
	*/
   public static XSSFCellStyle getNormalLeftStyleWithBorder(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setWrapText(true);
	   return style;
   }

 //--------------------------------------------360字体修改-----------------------------------------
   /**
	* @desc 字体居左有边框不加粗（姓名内容）
	*/
   public static CellStyle getNormalLeftStyleWithoutBorder(Workbook wb) {
	   CellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setWrapText(true);
	   return style;
   }
   /**
	* @desc 字体居左有边框加粗
	*/
   public static CellStyle getLeftStyleWithoutBorder(Workbook wb) {
	   CellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   style.setWrapText(true);
	   return style;
   }
   /**
	* @desc 字体居左无边框加粗
	*/
   public static CellStyle getLeftStyleWithBorder(Workbook wb) {
	   CellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.LEFT);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(true);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setWrapText(true);
	   return style;
   }
   /**
	 * @desc 字体居中并且有边框不加粗
	 */
   public static XSSFCellStyle getNormalCenterStyleWithoutBorder(XSSFWorkbook wb) {
		XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   XSSFFont font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   XSSFDataFormat df = (XSSFDataFormat) wb.createDataFormat(); // 此处设置数据格式
	   style.setDataFormat(df.getFormat("#,#0.00"));
	   return style;
	}
   /**
	* @desc 字体居中并且有边框加粗（能力）
	*/
   public static XSSFCellStyle getCenterStyleWithBorder(XSSFWorkbook wb) {
	   XSSFCellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setBold(true);
	   style.setFont(font);
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   XSSFDataFormat df = (XSSFDataFormat) wb.createDataFormat(); // 此处设置数据格式
	   style.setDataFormat(df.getFormat("#,#0.00"));
	   return style;
   }
   /**
	 * @desc 亮绿背景，字体居中并且有边框不加粗（基本信息（姓名））
	 */
   public static CellStyle getNormalCenterStyleWithBorder(Workbook wb) {
   	   CellStyle style = wb.createCellStyle();
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   Font font = wb.createFont();
	   font.setBold(false);
	   font.setFontName("微软雅黑");
	   style.setFont(font);
	   style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	   style.setFillForegroundColor(IndexedColors.BRIGHT_GREEN.getIndex());
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   DataFormat df = wb.createDataFormat(); // 此处设置数据格式
	   style.setDataFormat(df.getFormat("#,#0.00"));
	   return style;
	}
   /**
	* 字体居中，有边框，加粗，字号自定义
	*/
   public static CellStyle getCenterFontBoldStyle(Workbook wb, int fontSize){
	   CellStyle style = wb.createCellStyle();
	   //字体居中
	   style.setAlignment(HorizontalAlignment.CENTER);//水平居中
	   style.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
	   style.setBorderBottom(BorderStyle.THIN);
	   style.setBorderLeft(BorderStyle.THIN);
	   style.setBorderRight(BorderStyle.THIN);
	   style.setBorderTop(BorderStyle.THIN);
	   Font font = wb.createFont();
	   font.setFontName("微软雅黑");
	   font.setFontHeightInPoints((short)fontSize);
	   font.setBold(true);//字体增粗
	   style.setFont(font);
	   return style;
   }

	/**
	 * 黄背，白字
	 */
	public static CellStyle getErrorStyle(XSSFWorkbook wb) {
		XSSFCellStyle cellStyle = wb.createCellStyle();
		cellStyle.setAlignment(HorizontalAlignment.LEFT);
		cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
		Font font = wb.createFont();
		font.setFontName("微软雅黑");
		font.setBold(true);
		font.setColor(HSSFColor.HSSFColorPredefined.RED.getIndex());
		cellStyle.setFont(font);
		return cellStyle;
	}
}
